<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% request.setCharacterEncoding("UTF-8"); %>

<%-- 导入标签库 --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%-- 使用标签库中的标签 --%>
<c:choose>
    <c:when test="${ 'afang' != param.username }">
        <c:set var="message" value="用户名错误" scope="session" />
        <c:redirect url="/index.jsp" />
    </c:when>
    <c:when test="${ 'haoshuai' != param.password }">
        <c:set var="username" value="${param.username}" scope="session" />
        <c:set var="message" value="密码错误" scope="session" />
        <c:redirect url="/index.jsp" />
    </c:when>
    <c:otherwise>
        <jsp:forward page="/WEB-INF/success.jsp"></jsp:forward>
    </c:otherwise>
</c:choose>
